package com.codedancer.campus.mapper;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.codedancer.campus.common.core.BaseMapper;
import com.codedancer.campus.po.CommentReportType;
import com.codedancer.campus.qo.commentReport.CommentReportTypeSearchQo;
import java.util.List;

public interface CommentReportTypeMapper extends BaseMapper<CommentReportType> {

  /**
   * 获取全部评论举报类型
   *
   * @param commentReportTypeSearchQo
   * @return
   */
  default List<CommentReportType> list(CommentReportTypeSearchQo commentReportTypeSearchQo) {
    LambdaQueryWrapper<CommentReportType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
    if (ObjectUtil.isNotEmpty(commentReportTypeSearchQo.getName())) {
      lambdaQueryWrapper.like(CommentReportType::getName, commentReportTypeSearchQo.getName());
    }
    return selectList(lambdaQueryWrapper);
  }
}
